<template>
  <div class="subsidy_about">
    <div class="header">
      <Header-Comp title="补贴明细" bgColor="none" />
      <div class="header_content">
        <div class="time">{{detailData.qryAcStartTime || $route.query.quotaStartTime}} 至 {{detailData.qryAcEndTimeTmp || $route.query.quotaEndTime}}</div>
        <div class="about">
          <div class="count_money">
            <div class="number">{{detailData.quotaBalAmtSum || 0}}</div>
            <div class="str">额度包余额</div>
          </div>
          <div class="line"></div>
          <div class="count_money">
            <div class="number">{{detailData.subsidyAmtSum || 0}}</div>
            <div class="str">合计补贴金额</div>
          </div>
        </div>
      </div>
    </div>
    <div class="content" v-if="detailData.actQuotaDaySumList && detailData.actQuotaDaySumList.length">
      <div class="title_box">
        <div class="title_item">补贴时间</div>
        <div class="title_item">支付金额</div>
        <div class="title_item">补贴金额</div>
        <div class="title_item">额度包余额</div>
      </div>
      <div class="data_box" v-for="item in detailData.actQuotaDaySumList" :key="item.id">
        <div class="data_item">{{item.acDt}}</div>
        <div class="data_item">{{item.stlAmt}}</div>
        <div class="data_item">{{item.subsidyAmt}}</div>
        <div class="data_item">{{item.quotaBalAmt}}</div>
      </div>
    </div>
    <img v-else class="haveNotData" src="../../../assets/img/haveNotData.png" alt="">
  </div>
</template>


<script>
import { actQuotaStatisticsList } from "@/api/agent";
export default {
  data() {
    return {
      detailData: {
        actQuotaDaySumList: []
      }
    }
  },
  mounted() {
    this.actQuotaStatisticsList()
  },
  methods: {
  actQuotaStatisticsList() {
    const { storeNo, quotaId, statTime } = this.$route.query
    actQuotaStatisticsList({storeNo, quotaId, statTime}).then(res => {
      let { data } = res.data
      data.actQuotaDaySumList?.forEach(item => {
        item.qryAcStartTime = item.qryAcStartTime.split(' ')
        item.qryAcEndTimeTmp = item.qryAcEndTimeTmp.split(' ')
        item.stlAmt = (+item.stlAmt).toFixed(2)
      })
      data.subsidyAmtSum = (+(data?.subsidyAmtSum || 0))?.toFixed(2)
      data.stlAmtSum = (+((data?.stlAmtSum) || 0))?.toFixed(2)
      this.detailData = data
    })
  }
 } 
}
</script>


<style lang="less" scoped>
  .subsidy_about {
    .header {
      background-image: url('../../../assets/img/bg@2x.png');
      background-repeat: no-repeat;
      background-size: 100% 100%;
      height: 507px;
      .header_content {
        display: flex;
        flex-direction: column;
        align-items: center;
        .time {
          margin-top: 20px;
          font-size: 28px;
          font-family: PingFang SC;
          font-weight: 500;
          color: #3C1F02;
        }
        .about {
          margin-top: 60px;
          display: flex;
          align-items: center;
          .count_money {
            width: 300px;
            display: flex;
            flex-direction: column;
            align-items: center;
            .number {
              font-size: 48px;
              font-family: PingFang SC;
              font-weight: 500;
              color: #3C1F02;

            }
            .str {
              font-size: 26px;
              font-family: PingFang SC;
              font-weight: 500;
              color: #3C1F02;
            }
          }
          .line {
            height: 50px;
            width: 1px;
            background: #D4961D;
          }
        }
      }
    }
    height: 100%;
    background: #F5F5F5;
    .content {
      box-sizing: border-box;
      margin: 32px 32px 96px 32px;
      background: #FFFFFF;
      box-shadow: 0px 0px 4px 0px rgba(34,34,34,0.1);
      border-radius: 15px;
      .title_box {
        background: #F3F5F9;
        border-radius: 15px 15px 0 0;
        display: flex;
        
        justify-content: space-between;
        align-items: center;
        font-size: 26px;
        font-family: PingFang SC;
        font-weight: 500;
        color: #131313;
        opacity: 0.7;
        height: 56px;
        .title_item {
          flex: 1;
          display: flex;
          justify-content: center;
          align-items: center;
        }
      }
      .data_box {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 70px;
        border-bottom: 1px solid #F3F5F9;
        font-size: 24px;
        font-family: PingFang SC;
        font-weight: 500;
        color: #131313;
        opacity: 0.7;

        .data_item {
          flex: 1;
          display: flex;
          justify-content: center;
          align-items: center;
        }
      }
    }
    .haveNotData {
      position: relative;
      transform: translateX(-50%);
      left: 50%;
      margin: 150px 0;
      width: 400px;
    }
  }

</style>